<html>
<head><meta charset="utf-8"><title>Clippy on nightly · clippy · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/index.html">clippy</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Clippy.20on.20nightly.html">Clippy on nightly</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="228411680"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Clippy%20on%20nightly/near/228411680" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ThibsG <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Clippy.20on.20nightly.html#228411680">(Mar 02 2021 at 13:48)</a>:</h4>
<p>Hello, I'm trying to run Clippy on code that is based on nightly (ie: <code>nightly-2021-02-23</code>) and it doesn't work. I get the following error:</p>
<div class="codehilite"><pre><span></span><code>error: failed to execute compile
caused by: Compiler not supported: &quot;error: Unrecognized option: \&#39;E\&#39;\n\n&quot;
</code></pre></div>
<p>I saw this issue <a href="https://github.com/rust-lang/rust-clippy/issues/6487">https://github.com/rust-lang/rust-clippy/issues/6487</a> but I'm unsure what's the conclusion.<br>
Is it still possible to run Clippy on nightly based code? Or maybe we should set/unset some env variable?</p>



<a name="228414878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Clippy%20on%20nightly/near/228414878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Clippy.20on.20nightly.html#228414878">(Mar 02 2021 at 14:09)</a>:</h4>
<p>what do you mean with nightly-based code?</p>



<a name="228415002"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Clippy%20on%20nightly/near/228415002" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Clippy.20on.20nightly.html#228415002">(Mar 02 2021 at 14:10)</a>:</h4>
<p>do you wan to run a locally built clippy on a crate that was built with the nightly compiler?</p>



<a name="228415271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Clippy%20on%20nightly/near/228415271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Clippy.20on.20nightly.html#228415271">(Mar 02 2021 at 14:12)</a>:</h4>
<p>you can change this line <br>
<a href="https://github.com/rust-lang/rust-clippy/blob/master/rust-toolchain#L2">https://github.com/rust-lang/rust-clippy/blob/master/rust-toolchain#L2</a><br>
to "nightly" and it will try to compile clippy with whatever nightly you have (this may or may not succeed, but it looks like right now it works :) )</p>



<a name="228416952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Clippy%20on%20nightly/near/228416952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ThibsG <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Clippy.20on.20nightly.html#228416952">(Mar 02 2021 at 14:22)</a>:</h4>
<p>My bad, I have a project which has <code>rust-toolchain</code> file set-up to <code>nightly-2021-02-25</code>.<br>
When I run <code>cargo clippy --workspace --all-targets --all-features -- -D warnings</code> in this project, I get the <code>Compiler not supported</code> error</p>



<a name="228417321"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Clippy%20on%20nightly/near/228417321" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Clippy.20on.20nightly.html#228417321">(Mar 02 2021 at 14:24)</a>:</h4>
<p>do you have the clippy component downloaded for that nightly? <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="228417853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Clippy%20on%20nightly/near/228417853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ThibsG <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Clippy.20on.20nightly.html#228417853">(Mar 02 2021 at 14:27)</a>:</h4>
<div class="codehilite"><pre><span></span><code>info: syncing channel updates for &#39;nightly-2021-02-25-x86_64-unknown-linux-gnu&#39;
info: latest update on 2021-02-25, rust version 1.52.0-nightly (a8486b64b 2021-02-24)
info: downloading component &#39;cargo&#39;
info: downloading component &#39;clippy&#39;
info: downloading component &#39;rust-docs&#39;
info: downloading component &#39;rust-std&#39;
info: downloading component &#39;rustc&#39;
info: downloading component &#39;rustfmt&#39;
info: installing component &#39;cargo&#39;
info: installing component &#39;clippy&#39;
info: installing component &#39;rust-docs&#39;
info: installing component &#39;rust-std&#39;
info: installing component &#39;rustc&#39;
info: installing component &#39;rustfmt&#39;
</code></pre></div>
<p>Yes <span aria-label="nerd" class="emoji emoji-1f913" role="img" title="nerd">:nerd:</span></p>



<a name="228418151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Clippy%20on%20nightly/near/228418151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Clippy.20on.20nightly.html#228418151">(Mar 02 2021 at 14:28)</a>:</h4>
<p>I wonder if that <code>-E</code> actually comes from some rust-c/c++ interaction, I've seen that  a couple of times<br>
do you use sccache?</p>



<a name="228418262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Clippy%20on%20nightly/near/228418262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Clippy.20on.20nightly.html#228418262">(Mar 02 2021 at 14:29)</a>:</h4>
<p>I sometimes have to <code>CC=clang CXX=clang++ cargo build</code> because cmake scripts get confused by <code>sccache clang++   &lt;flags&gt;</code></p>



<a name="228418330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Clippy%20on%20nightly/near/228418330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Clippy.20on.20nightly.html#228418330">(Mar 02 2021 at 14:29)</a>:</h4>
<p>but than again the problem should not be specific to cargo clippy but also cargo check... <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="228418334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Clippy%20on%20nightly/near/228418334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ThibsG <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Clippy.20on.20nightly.html#228418334">(Mar 02 2021 at 14:29)</a>:</h4>
<p>huhu seems related to sccache</p>



<a name="228418514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Clippy%20on%20nightly/near/228418514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ThibsG <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Clippy.20on.20nightly.html#228418514">(Mar 02 2021 at 14:30)</a>:</h4>
<p>If I run the rustc command manually, nothing happen. But I get the same error with sccache<br>
Time for cleanup I guess <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span></p>



<a name="228428570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Clippy%20on%20nightly/near/228428570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ThibsG <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Clippy.20on.20nightly.html#228428570">(Mar 02 2021 at 15:28)</a>:</h4>
<blockquote>
<p>I wonder if that -E actually comes from some rust-c/c++ interaction, I've seen that a couple of times do you use sccache?</p>
</blockquote>
<p>Ah! Our code is using bindgen and <code>build.rs</code> so yes it can be a bad rust-c/c++ interaction</p>
<p>Well... and removing sccache cache folder didn't solve the problem, so I needed to disable sccache to make Clippy works again.<br>
Not sure what's going on, I also tried to update version of sccache but the issue is still here.</p>



<a name="228429084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Clippy%20on%20nightly/near/228429084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Clippy.20on.20nightly.html#228429084">(Mar 02 2021 at 15:31)</a>:</h4>
<p>Oh yeah, that is a known issue: <a href="https://github.com/rust-lang/cargo/issues/8143">https://github.com/rust-lang/cargo/issues/8143</a>. It was a trait off between the long standing cargo check -&gt; cargo clippy bug vs, sccache not working with Clippy.</p>



<a name="228429213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Clippy%20on%20nightly/near/228429213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Clippy.20on.20nightly.html#228429213">(Mar 02 2021 at 15:32)</a>:</h4>
<p>(I thought this is tracked somewhere, but couldn't find a better issue talking about the sccache problem)</p>



<a name="228429519"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Clippy%20on%20nightly/near/228429519" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Clippy.20on.20nightly.html#228429519">(Mar 02 2021 at 15:34)</a>:</h4>
<p><a href="https://github.com/mozilla/sccache/issues/966">https://github.com/mozilla/sccache/issues/966</a></p>



<a name="228430142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Clippy%20on%20nightly/near/228430142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ThibsG <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Clippy.20on.20nightly.html#228430142">(Mar 02 2021 at 15:37)</a>:</h4>
<p>oh thanks ! at least it's a known bug <span aria-label="wink" class="emoji emoji-1f609" role="img" title="wink">:wink:</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>